package com.heima.wemedia.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 将自定义拦截器添加到springMvc配置中
 *
 * @author zhouao
 * @date 2022/06/14
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
    /**
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //设置配置拦截器和拦截路径
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
    }
}
